<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>    
<%@ page import="java.util.*" %>
<%@ page import="org.swim.entity.Ability" %>
<%@ page import="org.swim.entity.User" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
	<title>Add Ability Request</title>
	<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
</head>
<body>
	<%@ include file="NavBar.jsp" %>
	<div class="container">
	<h1>Add Ability</h1>
	<% 
	boolean areThereAbilities = (Boolean) request.getAttribute("areThereAbilities"); 
	if(areThereAbilities) {
		List<Ability> abilities = (List<Ability>) request.getAttribute("abilities"); 
		User user = (User) session.getAttribute("user");
		int id = user.getId();
	%> 
	<div class="container">
	<form action="SendAdminAbilityRequest" method="post" class="navbar-search pull-left">
	<% for (Ability current: abilities) {  %>
		<div class="row">
			<label class="radio">
				<input type="radio" name="ability" value="<% out.print(current.getIdAbilita()); %>"><% out.print(current.getNome()); %>
			</label>	
		</div>
	<% } %>
		<button type="submit" class="btn">Add</button>
	</form>
	</div>
	<% } else { %>
		<div class="alert alert-info"><strong>No abilities:</strong> there are no abilities you can add</div>
	<% } %>
	</div>
</body>
</html>